﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BOHVote.Common;
using BOHVote.Entity;
 

namespace BOH.AccreditationSystem
{
    public partial class AccreditationSystem : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = common.getAppSetting("AppName");
            ((HiddenField)this.Master.FindControl("hiddenPageName")).Value = "AS";
            if (Session["User"] != null)
            {
                BHUser user = (BHUser)Session["User"];
                SetVisible(user.RightType);
            }
        }

        protected void SetVisible(string UserType)
        {
            switch (UserType)
            {
                case"G":
                    liPPT.Visible = false;
                    liEI.Visible = false;
                    liIV.Visible = true ;
                    liIVSet.Visible = false;
                    liIVPrint.Visible = true;
                    break;
                case "S":
                    liPPT.Visible = false;
                    liEI.Visible = false;
                    liIV.Visible = false;
                    liIVSet.Visible = false;
                    liIVPrint.Visible = false;
                    //liquestions.Visible = true;
                    //liresult.Visible = false;
                    break;
                case "C":
                case "A":
                    liEI.Visible = true;
                    liIV.Visible = true;
                    liPPT.Visible = true;
                    liIVSet.Visible = true;
                    liIVPrint.Visible = true;
                    //liresult.Visible = true;
                    break;
                default:
                    break;
            }
        }
    }
}
